package es.unex.meigas.gui;

import es.unex.meigas.core.AdministrativeUnit;
import es.unex.meigas.core.Cruise;
import es.unex.meigas.core.DasocraticElement;
import es.unex.meigas.core.FixedRadiusPlot;
import es.unex.meigas.core.Plot;
import es.unex.meigas.core.Stand;
import es.unex.meigas.core.Tree;

public class PanelFactory {
	
	public static DasocraticElementPanel getPanel(DasocraticElement element,
												  MeigasPanel panel){

		if (element instanceof AdministrativeUnit){
			return new AdministrativeUnitPanel((AdministrativeUnit) element, panel);
		}			
		else if(element instanceof Stand){
			return new StandPanel((Stand) element, panel);
		}
		else if(element instanceof Cruise){
			return new CruisePanel((Cruise) element, panel);
		}
		else if(element instanceof Plot){
			return new PlotPanel((Plot) element, panel);
		}
		else if(element instanceof Tree){
			return new TreePanel((Tree) element, panel);
		}
			
		return null;
	}

}
